<template>
	<div class="container">
		<div v-if='dom'>
			<Admin></Admin>
		</div>
		<div v-else>
			<Student></Student>
		</div>
	</div>
</template>

<script setup name="panel">
import Admin from "./components/Admin.vue"
import Student from "./components/Student.vue"
import { onMounted, ref } from "vue"
import { GlobalStore } from "@/stores";
const globalStore = GlobalStore();
const dom = ref();
const getType = () => {
	let type = globalStore.userInfo.type;
	if (type === 'admin') {
		dom.value = 1
	} else {
		dom.value = 0;
	}
}
onMounted(() => {
	getType()
	// console.log(globalStore.userInfo.type)
})

</script>

<style lang="scss" scoped></style>
